#include<bits/stdc++.h>
#define ll long long 
using namespace std;
typedef struct node{
    int data;
    struct node* next;
}node,*slist;
slist forwardCreat(slist &L){
    L=(node*)malloc(sizeof(node));
    L->next=NULL;
    node *s,*r=L;
    int x;
    cin>>x;
    while(x!=114514){
        s=(node*)malloc(sizeof(node));
        s->data=x;
        r->next=s;
        r=s;
        cin>>x;

    }
    r->next=NULL;
    return L;
}
void printlist(slist L){
    node *p=L->next;
    int i=1;
    while(p!=NULL){
        cout << "node " << i << " is:" << p->data << endl;
        p=p->next;
        i++;
    }
}
slist find_with_index(slist &L,int i){
    node *p=L;
    int j=0;
    while(p!=NULL&&j<i){
        p=p->next;
        j++;

    }
    return p;
}
slist find_with_value(slist &L,int e){
    node* p=L;
    int i=0;
    while(p!=NULL){
        p=p->next;
        i++;
        if(p->data==e){
            return p;
        }
    }
    return NULL;
}
slist add_with_index(slist &L,int i,int e){
    node* p=find_with_index(L,i-1);
    node* s=new node;
    s->next=p->next;
    p->next=s;
    s->data=e;
    return L;
}
slist del_with_index(slist &L,int i){
    node* p=find_with_index(L,i-1);
    node* ans=p->next;
    p->next=ans->next;
    delete(ans);
    return L;
    
}
bool postInsert(node* p,int e){
    node *s=new node;
    s->next=p->next;
    p->next=s;
    s->data=e;
    if(s!=NULL){
        return true;
    }
}
bool preInsert(node* p,int e){
    node *s=new node;
    if(s==NULL){
        return false;
    }
    s->next=p->next;
    p->next=s;
    s->data=p->data;
    p->data=e;
    return true;
}
bool delP(node* p){
    if(p==NULL||p->next==NULL){
        return false;
    }
    node *tmp=p->next;
    p->next=tmp->next;
    delete(tmp);
    return true;
}
slist head_insert(slist &L){
    node *s;
    int x;
    cin>>x;
    L->next=NULL;
    while(x!=114514){
        s=new node;
        s->data=x;
        s->next=L->next;
        L->next=s;
        cin>>x;
    }
    return L;
}
int main()
{
slist L;
head_insert(L);
printlist(L);




return 0;
}